<?php
include("./database/db.php");
$mysql=new mysql();
$sql="select * from shop";
$shop=$mysql->getAll($sql);
$arr = array();
foreach ($shop as $k=>$v) {
	$arr[$k][shopid]=$v[shopid];
	$arr[$k][shopname]=$v[name];
	$zifenleiid = array();
	$zifenleiname= array();
	$sql="select * from zifenlei where fenleiid='".$v[leimu]."'";
	$zifenlei=$mysql->getAll($sql);
	foreach ($zifenlei as $w) {
		$zifenleiid[]=$w[id];
		$zifenleiname[]=$w[name];
	}
	$arr[$k][zifenleiid]=$zifenleiid;
	$arr[$k][zifenleiname]=$zifenleiname;
}
echo json_encode($arr);